The following data is on New Orleans tornado building damage during December 2022. This data was obtained from Verisk Analytics and it was derived computer vision and machine learning using post-catastrophe aerial imagry data. There are approximately 42,000 buildings in this dataset.
I converted roof_solar into a T/F statement, by converting “SOLAR PANEL” to TRUE and “NO SOLAR PANEL” to FALSE. In addition to this, I converted the roof shapes that the computer wasn’t very sure about (up to a 20% chance of being incorrect) into NA. There were some cells in damage_level where they were filled with an empty character, so I converted that into NA as well. I then separated longitude and latitude so that it could be easily read into leaflet.
Catastrophe scores are separated by the summary of the dataset, excluding the catastrophe scores of 0.
mostdamage <- df %>% filter(catastrophescore >= 50)
# middamage <- df %>% filter(catastrophescore < 50 & catastrophescore > 25)
# leastdamage <- df %>% filter(catastrophescore < 25 & catastrophescore != 0)
nodamage <- df %>% filter(catastrophescore == 0)
decimated <-df %>% filter(catastrophescore == 100)
# # Might work better based on quartiles of attributes selected
middamage <- df %>% filter(catastrophescore < 50 & catastrophescore >= 15)
leastdamage <- df %>% filter(catastrophescore < 15 & catastrophescore >= 2)
minimaldamage <- df %>% filter(catastrophescore == 1)
See if there are better markers to use for this: see If i can add labels with the long, lat, roof shape, and catastrophescore.
These are the buildings that sustained damage
Red indicates the buildings that were the most damaged (catastrophe score >= 50), orange indicates (25 < catastrophe score < 50), blue indicates (catastrophe score <= 25, excluding scores of 0). The majority of the buildings (3852) exhibited a catastrophe score of 0.
Map of the buildings that experienced damage:
Map of the buildings that experienced the most damage:
Map of the buildings that experienced mid damage:
Map of the buildings that experienced the least damage:
Map of the buildings that experienced no damage:
Map of the buildings that experienced no damage and the most damage:
## catastrophescore ~ long + lat + roofshape + rooftree + roofmateri
## <environment: 0x12c050c50>
## catastrophescore ~ long + lat + trampoline + deck + pool + enclosure +
## divingboar + waterslide + playground + sportcourt + primarystr +
## roofsolar + rooftree + roofmateri * roofshape
## <environment: 0x10a206390>
## catastrophescore ~ long + lat + enclosure + roofmateri + roofsolar +
## rooftree + roofshape
## <environment: 0x12c4b7bd8>
Model 1
Model 2
Model 3
names(df)
summary(mod1) summary(mod2) summary(mod3)
df <- add_predictions(penguins, mod2, type = “response”) # this changes predictions to a readable percentage # at 2, you can see a 77% chance of a female being a male (not correct) add_predictions(penguins, mod2, type = “response”) %>% ggplot(aes(x=body_mass_g, y=pred, color =sex)) + # geom_smooth() + geom_point(size = 3, alpha =.5) # Plots
Completely Destroyed: wow <- leaflet() %>% addTiles() %>%
addCircleMarkers(lng=decimated\(long,
lat=decimated\)lat, color = “red”, radius = 2) %>%
addLabelOnlyMarkers(data = decimated, label = ~paste(“Roof shape:”,
roofshape, “
”, “Roof material:”, roofmateri, “
”, “Catastrophe
score:”, catastrophescore, “
”, “Latitude:”, lat, “
”,
“Longitude:”, long), labelOptions = labelOptions(noHide = TRUE, textOnly
= FALSE, direction = “auto”))
practice <- df[1:20,] m <- leaflet(data = practice) %>% addTiles() %>% # Add default OpenStreetMap map tiles addMarkers(lng=practice\(long, lat=practice\)lat, popup=“Example”) m # Print the map